Skip to content

Add Claude Code on the web SessionStart hook (Rust + Elixir)#155

Merged
hyperpolymath merged 2 commits into
mainfrom
claude/beautiful-edison-x0o5ke
Jun 21, 2026
Merged

Add Claude Code on the web SessionStart hook (Rust + Elixir)#155
hyperpolymath merged 2 commits into
mainfrom
claude/beautiful-edison-x0o5ke

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What

Adds a cloud-only SessionStart hook so Claude Code on the web sessions start with VeriSimDB's toolchain ready. Cloud images ship cargo but not Erlang/Elixir (which elixir-orchestration needs), so the hook installs them and warms the workspace.

Changes (.claude/)

.claude/hooks/session-start.sh — cloud-only (CLAUDE_CODE_REMOTE), idempotent, best-effort:

  • Installs Erlang (apt, OTP 25) + Elixir 1.17 (precompiled from GitHub, built for OTP 25) — satisfies elixir-orchestration's elixir: "~> 1.17".
  • Warms Rust with cargo fetch (the ~20-crate workspace compiles on first use — too heavy to build synchronously every session).
  • Best-effort mix deps.get for the Elixir deps.

Plus .claude/settings.json (registers the hook on startup|resume) and a REUSE.toml annotation covering .claude/**.

Scope notes

  • ReScript playground intentionally excluded — per current policy ReScript is banned (the estate frontend is moving to AffineScript), so the hook only sets up the active toolchains (Rust + Elixir). (Note: this repo's CLAUDE.md still lists ReScript as allowed — worth reconciling.)
  • Every step is best-effort so a blocked registry never aborts session startup.

Network caveat (important)

mix deps.get needs the Hex registry (repo.hex.pm / builds.hex.pm). On a restrictive Trusted network allowlist those are blocked (HTTP 403) and skipped cleanly; on Full network access they complete. cargo works on Trusted (crates.io is allowlisted). For faster startup, the install step is a good candidate to move to a cached Setup Script (environment config).

Validation (in a cloud session)

  • ✅ Hook exits 0; installs Erlang + Elixir (mix 1.17.3) and runs cargo fetch
  • ✅ Local-skip is a no-op when CLAUDE_CODE_REMOTE is unset
  • ⚠️ mix deps.get 403s on this session's Trusted network (degrades gracefully, as designed) — validates fully only on Full network

Note

Synchronous hook: it guarantees the toolchain is ready before the session starts, at the cost of install time on first run. Can switch to async, or move installs to a cached Setup Script, if preferred.

🤖 Generated with Claude Code

https://claude.ai/code/session_017nyxs8RgqZa72PzrTu3L75


Generated by Claude Code

Cloud sessions ship cargo but not Erlang/Elixir, which the
elixir-orchestration layer needs. Adds a cloud-only SessionStart hook that:

- installs Erlang (apt, OTP 25) + Elixir 1.17 (GitHub precompiled, satisfies
  elixir-orchestration's `elixir: "~> 1.17"`), idempotently;
- warms the Rust workspace with `cargo fetch` (the ~20-crate build compiles
  on first use — too heavy to run synchronously every session);
- best-effort `mix deps.get` for the Elixir deps.

Every step is best-effort and cloud-only (CLAUDE_CODE_REMOTE) so it never
aborts session startup. Network note: `mix deps.get` needs Hex registry
access (repo.hex.pm / builds.hex.pm); on a restrictive "Trusted" allowlist
those are blocked (403) and skipped cleanly, on "Full" access they complete.
cargo works on Trusted (crates.io is allowlisted).

REUSE.toml: cover .claude/** under MPL-2.0 (settings.json carries no inline
SPDX header; the hook script has one).

Validated in a cloud session: hook exits 0, installs Erlang+Elixir (mix
1.17.3) and runs cargo fetch; local-skip is a no-op; the Hex-blocked
mix step degrades gracefully.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017nyxs8RgqZa72PzrTu3L75
@hyperpolymath
hyperpolymath marked this pull request as ready for review June 21, 2026 14:06
@hyperpolymath
hyperpolymath merged commit 0288818 into main Jun 21, 2026
1 check failed
@hyperpolymath
hyperpolymath deleted the claude/beautiful-edison-x0o5ke branch June 21, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants